package com.modbus.api;

import com.modbus.eum.ModbusEnum;
import com.modbus.service.IModbusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;
/**
 * @author heyayun
 */
@Api(tags = "监控功能接口")
@RestController
@RequestMapping("/modbus")
public class ModbusController {
    @Autowired
    private IModbusService modbusService;

    @GetMapping("/get")
    @ApiOperation("获取监控数据")
    public void get(int address, int unitId, ModbusEnum modbusEnum, int typeId) throws ExecutionException, InterruptedException {
        modbusService.get(address, unitId, modbusEnum, typeId);
    }
}
